<?php
// $cid=3;
// $tm=time();
// $str=md5($tm.'jdgldd102ssssss'.'mbhyeb1422068271'.$cid);

// $url = "http://vip.vcdes.com/index.php?g=Webs&m=Vdingdan&a=index&token=mbhyeb1422068271&cid=$cid&status=20160326&str=$str&tm=$tm&st[]=1511625600&st[]=1611712000";

// echo $url;
// $result = file_get_contents($url); //获取源数据
// // $result = mb_substr($result, 5);   //去除源数据的<pre>标签
// echo "<pre>";
// $data = json_decode($result, true); //转数组

// foreach ($data as $key => &$value) {
//     $value['info'] = unserialize($value['info']);  //把菜谱反序列化回来成数组
// }
// 
// 
$cid=1100;
$tm=time();
$str=md5($tm.'jdgldd102ssssss'.'yibmnt1511770872'.$cid);



$url = "http://vip.vcdes.com/index.php?g=Webs&m=Vdingdan&a=index&token=yibmnt1511770872&cid=$cid&str=$str&tm=$tm&st[]=".strtotime('-30 day')."&st[]=".strtotime('+30 day')."";

$result = file_get_contents($url);
$data = json_decode($result, true); //转数组
$total = 0;
foreach ($data as $key => &$value) {
    $value['info'] = unserialize($value['info']);  //把菜谱反序列化回来成数组
}
foreach ($data as $key => $value) {
    foreach ($value['info'] as $k => $v) {
        echo $v['price'] . '--------------';
        $total += $v['price'];
    }
    echo $total . PHP_EOL;
    $total = 0;
}

echo "<pre>";
// print_r($data);die;

die;




